-- scroll
-- create by cheny3
-- 滑动界面

return {
    -- 判断
    canTrigger = function(args)
        return true;
    end,

    -- 触发
    trigger = function(args)
        -- 找到当前打开的界面
        local formName = UIMgr.getCurrentScene():getCurrentForm();
        -- 找到scroll节点
        local scrollNode = findChildByName(formName.node, args["scroll_node"]);
        local durTime = math.random(0.5, 1);
        if math.random(1, 2) == 1 then
            scrollNode:scrollToTopLeft(durTime, true);
        else
            scrollNode:scrollToBottomRight(durTime, true);
        end
        return true;
    end,
};
